package school.valon.persistence.pojo;

import java.io.Serializable;

import javax.persistence.*;

import java.util.Date;
import java.util.List;


/**
 * The persistent class for the course_offering database table.
 * 
 */
@Entity
@Table(name="course_offering")
@NamedQueries({
@NamedQuery(name="CourseOffering.findAll", query="SELECT c FROM CourseOffering c"),
@NamedQuery(name="CourseOffering.deleteById", query="DELETE FROM CourseOffering WHERE courseOfferingId = :P1")
})
public class CourseOffering implements Serializable {

	private static final long serialVersionUID = 3037719672147510306L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="course_offering_id")
	private Integer courseOfferingId;

	@Temporal(TemporalType.DATE)
	@Column(name="end_date")
	private Date endDate;

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="school_id", referencedColumnName="school_id")
	private School school;

	@Temporal(TemporalType.DATE)
	@Column(name="start_date")
	private Date startDate;

	//bi-directional many-to-one association to Course
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="course_id")
	private Course course;

	//bi-directional many-to-one association to Staff
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="staff_id")
	private Staff staff;

	//bi-directional many-to-one association to CourseOfferingStudentEnrolment
	@OneToMany(mappedBy="courseOffering", fetch=FetchType.LAZY)
	private List<CourseOfferingStudentEnrolment> courseOfferingStudentEnrolments;

	//bi-directional many-to-one association to StudentClassRecording
	@OneToMany(mappedBy="courseOffering", fetch=FetchType.LAZY)
	private List<StudentClassRecording> studentClassRecordings;

	public Integer getCourseOfferingId() {
		return this.courseOfferingId;
	}

	public void setCourseOfferingId(Integer courseOfferingId) {
		this.courseOfferingId = courseOfferingId;
	}

	public Date getEndDate() {
		return this.endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public School getSchool() {
		return this.school;
	}

	public void setSchool(School school) {
		this.school = school;
	}

	public Date getStartDate() {
		return this.startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Course getCourse() {
		return this.course;
	}

	public void setCourse(Course course) {
		this.course = course;
	}

	public Staff getStaff() {
		return this.staff;
	}

	public void setStaff(Staff staff) {
		this.staff = staff;
	}

	public List<CourseOfferingStudentEnrolment> getCourseOfferingStudentEnrolments() {
		return this.courseOfferingStudentEnrolments;
	}

	public void setCourseOfferingStudentEnrolments(List<CourseOfferingStudentEnrolment> courseOfferingStudentEnrolments) {
		this.courseOfferingStudentEnrolments = courseOfferingStudentEnrolments;
	}

	public List<StudentClassRecording> getStudentClassRecordings() {
		return this.studentClassRecordings;
	}

	public void setStudentClassRecordings(List<StudentClassRecording> studentClassRecordings) {
		this.studentClassRecordings = studentClassRecordings;
	}
}